<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>互评的选择学生view</title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
		<link rel="stylesheet" href="../../css/weui.min.css" />
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/base.css"/>
		<style type="text/css" media="screen">
			.mui-table-view-cell:active {
				color: #222222;
			}
			.mui-checkbox input[type=checkbox]:checked:before, .mui-radio input[type=radio]:checked:before {
				/*color: #ffffff;*/
				display: inline-block;
				opacity: 0;
			}
			.mui-collapse input[type="radio"]:checked {/*当radiuo被选中时，把input下边的div标签的背景图片替换掉*/
				background: url(../../icon/icon_checkon.png) no-repeat;
				background-size: cover;
				width: 26px;
				height: 26px;
			}
			.mui-content1 {
				left: 0;
				-webkit-transform: scaleY(.5);
				transform: scaleY(.5);
				background-color: #ededed;
				top: -1px;
				height: 1px;
			}
			.mui-table-view-cell.mui-collapse .mui-collapse-content {
				padding: 0px 0px;
			}
			.noSign {
				background: #fff
			}
			.loadFailure{
			background: #fff
			}
		</style>
	</head>
	<body>
		<div class="base_style_color base_title_Immerse" id='BarAppearance' ></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar base_title_position" >
			<a class="base_left_item  nav-item" href="#" onclick="backClick()" style="color: #fff;" > 取消 </a>
			<span id="newsTitle">选择人员</span>
			<a class="base_right_item nav-item" id="wancheng"onclick="loaddata()">确定 </a>
		</div>
		<div  style="margin-top: 66px;">
			<ul class="mui-table-view" id="divlist">
				<!--<li class="mui-table-view-cell mui-collapse">
				<a class="mui-navigate-right" href="#">文字排版</a>
				<div class="mui-collapse-content   "  >
				<div class="mui-input-row mui-radio mui-left "  >
				<label>历史</label>
				<input name="radio" type="radio">
				</div>
				<div class="mui-content1"></div>
				</div>
				<div class="mui-collapse-content">
				<div class="mui-input-row mui-radio mui-left">
				<label>历史2</label>
				<div class="option"></div>
				<input name="radio" type="radio">
				</div>
				</div>
				<div class="mui-collapse-content">
				<div class="mui-input-row mui-radio mui-left">
				<label>历史3</label>
				<input name="radio" type="radio">
				</div>
				</div>
				</li>-->
			</ul>
			<div class="noSign" hidden="hidden" id="noData">
				<img src="../../image/icon_img.png" width="60%">
				<p class="font16 top_15 base_dark_grey" >
					暂无人员
				</p>
			</div>
			<div class="loadFailure" hidden="hidden" id="noNet">
				<img src="../../image/icon_img01.png" width="60%">
				<p class="" >
					数据加载失败
				</p>
				<p>
					请检查您的网络
				</p>
				<button type="button"  onclick="refreshData()"class="mui-btn mui-btn-outlined">
					重新加载
				</button>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/timeStampTool.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/mui.min.js"></script>
	<script type="text/javascript">
		var name = '';
		//学生名
		var stuid = '';
		//学生id
		var picurl = "";
		//用户头像
		apiready = function() {
			getTeamList();
			sendBuriedNotifi(0, '老师端互评添加人员页', '210');
		};
		function sendBuriedNotifi(busionessid, pagetype, pagetypeid) {
			var userinfo = {
				uid : $api.getStorage('cfnetppuid'),
				jid : $api.getStorage('cfnetppjxid'),
				uname : $api.getStorage('cfnetppusername'),
				//				cid : api.pageParam.cid,
				//				pid : api.pageParam.pid,
			}
			var data = {
				busionessid : busionessid,
				pagetype : pagetype,
				pagetypeid : pagetypeid,
				sourceurl : api.pageParam.sourceurl,
				sourcetitle : api.pageParam.sourcetitle,
				accesspageurl : window.location.pathname,
				accesspagetitle : document.title,
				userinfo : userinfo
			}
			SendBehaviorTrajectoriesNotifi_Study(data);
		}

		function getTeamList() {
			showProgress();
			var params = {
				jid : $api.getStorage('cfnetppjxid'),
				pid : api.pageParam.pid,
			}
			cfnetppPOST(url_planTeamList, params, true, function(data, status) {
				//			    				alert(JSON.stringify(data));
				api.hideProgress();
				if (status == 'success') {
					if (data.code == 200) {
						var data = data.data;
						var len = data.length;
						if (len > 0) {
							writelist(data, len);
						} else {
						$('#noData').show();
							$('#noNet').hide();
						}
					}else{
					$('#noData').show();
							$('#noNet').hide();
					}
				}else{
				     $('#noData').hide();
					 $('#noNet').show();
				}
			});
		}

		function writelist(data, len) {
			var strhtml = '';
			for (var i = 0; i < len; i++) {
				var stulist = data[i];
				var str = '<li class="mui-table-view-cell mui-collapse">' + '<a class="mui-navigate-right" href="#">' + stulist.names + '</a>' + writeTwolist(stulist.teamuser) + '</li>';
				strhtml = strhtml + str;
			}
			$('#divlist').append(strhtml);
		}

		function writeTwolist(data) {
			var strhtml = '';
			var len = data.length;
			if (len > 0) {
				for (var i = 0; i < len; i++) {
					var stulist = data[i];
					var str = '<div class="mui-collapse-content  " onclick="stuclick(' + stulist.uid + ',' + "'" + stulist.rename + "'" + ',' + "'" + stulist.picurl + "'" + ')">' + '<div class="mui-input-row mui-radio mui-left">' + '<label>' + stulist.rename + '</label>' + '<input name="radio" type="radio">' + '</div>	<div class="mui-content1"></div>' + '</div> ';
					strhtml = strhtml + str;
				}
			}
			return strhtml;
		}

		function stuclick(stuid1, name1, pic1) {
			stuid = stuid1;
			name = name1;
			picurl = pic1;
		}

		function loaddata() {
			api.sendEvent({
				name : 'selectStudentNotice',
				extra : {
					name : name,
					stuid : stuid,
					picurl : picurl
				}
			});
			api.closeWin({
			});
			sendBuriedNotifi(1, '老师端互评添加人员页', '210');
		}
	</script>
</html>